#include <iostream>
using namespace std;

int lowbit(int x)
{
	return x&(-x);
} 

int main()
{
	int n;
	while(cin>>n){
		cout<<lowbit(n)<<endl;
	}
	return 0;
}
